package com.example.demo1.filter;

import org.springframework.stereotype.Component;

import javax.servlet.*;
import javax.servlet.FilterConfig;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;

/**
 * @author sunjk
 * @since 2020/9/7
 */
@Component
public class SecondFilter implements Filter {
    @Override
    public void init(FilterConfig filterConfig) throws ServletException {

    }

    @Override
    public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {

        HttpServletRequest req = (HttpServletRequest) servletRequest;
        System.out.println("---------------------");
        filterChain.doFilter(servletRequest, servletResponse);
        System.out.println("+++++++++++++++++++++++");
    }

    @Override
    public void destroy() {

    }
}
